﻿Imports FitLib

Public Class Form1

    Dim Prop As PropertyGrid

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        ' Dim Parser As New FitLib.FitParser

        Dim stream As New IO.FileStream("Data\Test.fit", IO.FileMode.Open)
        Dim doc As FitLib.FitDocument = FitDocument.Parse(stream)
        stream.Close()
        stream.Dispose()
        '
        'BindToTree(TreeView1, doc, GetType(ActivityDocument))
        oiDocument.Item = doc
    End Sub

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        Dim frm As New OpenFileDialog
        If frm.ShowDialog = Windows.Forms.DialogResult.OK Then
            Dim stream As New IO.FileStream(frm.FileName, IO.FileMode.Open)
            Dim doc As FitLib.FitDocument = FitDocument.Parse(stream)
            stream.Close()
            stream.Dispose()

            Prop.SelectedObject = doc
            oiDocument.Item = doc
        End If

    End Sub
End Class
